home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / SuperiorCanfield.dxr / playing cards_58_f hot.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.5 KB  |  61 lines

  1. property spriteNum, row
  2. global stock, foundation, equal, currentsel, getlist, godlist, basecard, leftlist, rightlist
  3.  
  4. on beginSprite me
  5.   if listp(foundation) = 0 then
  6.     foundation = [:]
  7.   end if
  8.   row = determinerow()
  9.   foundation.addProp(row, new(script("card pile")))
  10. end
  11.  
  12. on determinerow me
  13.   if spriteNum = 33 then
  14.     return #fone
  15.   else
  16.     if spriteNum = 34 then
  17.       return #ftwo
  18.     else
  19.       if spriteNum = 35 then
  20.         return #fthree
  21.       else
  22.         if spriteNum = 36 then
  23.           return #ffour
  24.         end if
  25.       end if
  26.     end if
  27.   end if
  28. end
  29.  
  30. on mouseEnter me
  31.   if getlist <> VOID then
  32.     if foundation[row].getcardcount() = 0 then
  33.       if getlist.getlastcard().rank = basecard then
  34.         equal = 1
  35.         currentsel = spriteNum - 4
  36.         godlist = foundation[row]
  37.       end if
  38.     else
  39.       if foundation[row].getcardcount() > 0 then
  40.         if (getlist.getlastcard().rankvalue = (foundation[row].getlastcard().rankvalue + 1)) and (getlist.getlastcard().suit = foundation[row].getlastcard().suit) then
  41.           equal = 1
  42.           currentsel = spriteNum - 4
  43.           godlist = foundation[row]
  44.         else
  45.           if (getlist.getlastcard().rank = "ace") and (foundation[row].getlastcard().rank = "king") and (getlist.getlastcard().suit = foundation[row].getlastcard().suit) then
  46.             equal = 1
  47.             currentsel = spriteNum - 4
  48.             godlist = foundation[row]
  49.           end if
  50.         end if
  51.       end if
  52.     end if
  53.   end if
  54. end
  55.  
  56. on mouseLeave me
  57.   equal = 0
  58.   currentsel = 0
  59.   godlist = VOID
  60. end
  61.